﻿using Microsoft.Extensions.Configuration;

namespace dataXJobGenerator
{
    public class DataSourceConfiguration
    {
        public string DbType { get; private set; }
        public string ConnStr { get; private set; }

        public static DataSourceConfiguration GetDataSource(IConfiguration configuration)
        {
            var config = new DataSourceConfiguration();
            var dataSourceConfig = configuration.GetSection("dataSource");
            config.DbType = dataSourceConfig.GetValue("dbtype").ToUpper();
            config.ConnStr = dataSourceConfig.GetValue("connStr");

            return config;
        }
    }
}